package com.tedu.parkinglot.admin.controller;

import com.tedu.parkinglot.admin.pojo.dto.AdminLoginParam;
import com.tedu.parkinglot.admin.pojo.vo.AdminVO;
import com.tedu.parkinglot.admin.service.AdminService;
import com.tedu.parkinglot.base.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

@Slf4j
@RestController
@RequestMapping("/v1/admin/")
public class AdminController {
    @Autowired
    private AdminService adminService;
    @PostMapping("login")
    public JsonResult login(@RequestBody AdminLoginParam adminLoginParam){
        log.debug("adminLoginParam:{}",adminLoginParam);
        AdminVO adminVO = adminService.login(adminLoginParam);
        log.debug("adminVO:{}",adminVO);
        return JsonResult.ok(adminVO);
        //return null;
    }
}
